import api from './api'

// 系统设置相关的 API
export const settings = {
  // 获取系统设置
  getSettings: () => api.get('/api/admin/settings'),

  // 更新系统设置
  updateSettings: (data) => api.put('/api/admin/settings', data),

  // 获取系统统计数据
  getStats: () => api.get('/api/admin/stats'),

  // 获取最近活动
  getActivities: () => api.get('/api/admin/activities'),

  // 获取系统日志
  getLogs: (params) => api.get('/api/admin/logs', { params }),

  // 清理系统缓存
  clearCache: () => api.post('/api/admin/clear-cache'),

  // 备份数据
  backup: () => api.post('/api/admin/backup'),

  // 获取备份列表
  getBackups: () => api.get('/api/admin/backups'),

  // 恢复备份
  restoreBackup: (backupId) => api.post(`/api/admin/restore/${backupId}`),

  // 删除备份
  deleteBackup: (backupId) => api.delete(`/api/admin/backups/${backupId}`),

  // 测试邮件配置
  testEmail: (config) => api.post('/api/admin/test-email', config),

  // 测试存储配置
  testStorage: (config) => api.post('/api/admin/test-storage', config)
}
